package com.xinchao.controller;

import com.xinchao.core.BaseController;
import com.xinchao.core.util.HuaWeiCloudUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 
 * <p>Title: HuaWeiObsController</p>  
 * <p>Description: </p>  
 * @author huangf 
 * @date 2018年9月18日
 */
@Controller
@RequestMapping(value = "/huawei/obs")
public class HuaWeiObsController extends BaseController{

	@Autowired
	private  HuaWeiCloudUtils HuaWeiCloudUtils;

    @RequestMapping(value = "/read")
    public void listByPage(HttpServletRequest request,String url,HttpServletResponse response,Model model) throws IOException {
		HuaWeiCloudUtils.getFile(url,response);
		response.setContentType("application/octet-stream");
	}

}
